/* ==============================================
   春天主题CSS变量
   ============================================== */
:root {
  /* 春天色彩调色板 */
  --spring-primary: #4ade80;
  --spring-secondary: #22d3ee;
  --spring-accent: #f472b6;
  --spring-warm: #fbbf24;
  --spring-soft: #a78bfa;
  
  /* 渐变色 */
  --gradient-spring: linear-gradient(135deg, var(--spring-primary) 0%, var(--spring-secondary) 100%);
  --gradient-warm: linear-gradient(135deg, var(--spring-warm) 0%, var(--spring-accent) 100%);
  --gradient-soft: linear-gradient(135deg, var(--spring-soft) 0%, var(--spring-accent) 100%);
  --gradient-nature: linear-gradient(135deg, #dcfce7 0%, #dbeafe 50%, #fef7cd 100%);
  
  /* 背景色 */
  --bg-primary: #fafffe;
  --bg-secondary: #f0fdf4;
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-glass: rgba(255, 255, 255, 0.25);
  --bg-input: rgba(255, 255, 255, 0.8);
  
  /* 文字颜色 */
  --text-primary: #065f46;
  --text-secondary: #059669;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  
  /* 边框和阴影 */
  --border-color: rgba(34, 211, 238, 0.2);
  --shadow-light: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-heavy: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --shadow-spring: 0 10px 30px rgba(74, 222, 128, 0.3);
  
  /* 玻璃态效果 */
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
  --backdrop-blur: blur(20px);
  
  /* 尺寸 */
  --border-radius: 16px;
  --border-radius-large: 24px;
  
  /* 动画 */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  --gradient-pink-blue: linear-gradient(135deg, #d2f8d2 0%, #b6eec7 50%, #aee1f9 100%);
  --glass-bg: rgba(240, 255, 245, 0.7);
  --input-bg: rgba(230, 255, 240, 0.8);
  --shadow: 0 8px 32px rgba(120, 200, 120, 0.10);
  --radius: 16px;
  --pink: linear-gradient(135deg, #d2f8d2 0%, #b6eec7 50%, #aee1f9 100%);
  --blue: #aee1f9;
  --text: #2e4d2d;
}

/* 深色主题 */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: rgba(30, 41, 59, 0.95);
  --bg-glass: rgba(30, 41, 59, 0.25);
  --bg-input: rgba(51, 65, 85, 0.8);
  
  --text-primary: #dcfce7;
  --text-secondary: #86efac;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  
  --border-color: rgba(34, 211, 238, 0.3);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ==============================================
   全局样式重置
   ============================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: 'Poppins', 'Microsoft YaHei', sans-serif;
  line-height: 1.6;
}

body {
  background: 
    /* radial-gradient(circle at 20% 20%, rgba(74, 222, 128, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(34, 211, 238, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 40% 60%, rgba(244, 114, 182, 0.1) 0%, transparent 50%), */
    linear-gradient(135deg, rgb(234, 255, 234) 0%, rgb(249, 251, 231) 30%, rgb(182, 238, 199) 70%, rgb(174, 225, 249) 100%);
  background-size: 400% 400%;
  animation: gradientFlow 20s ease infinite;
  color: var(--text-primary);
  overflow-x: hidden;
}

@keyframes gradientFlow {
  0%, 100% { background-position: 0% 50%; }
  25% { background-position: 100% 0%; }
  50% { background-position: 100% 100%; }
  75% { background-position: 0% 100%; }
}

/* ==============================================
   春天装饰元素
   ============================================== */
.spring-decorations {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

/* 飘落花瓣 */
.floating-petals {
  position: absolute;
  width: 100%;
  height: 100%;
}

.petal {
  position: absolute;
  width: 8px;
  height: 12px;
  background: var(--spring-accent);
  border-radius: 50% 10% 50% 10%;
  opacity: 0.7;
  animation: petalFall linear infinite;
}

.petal:nth-child(1) { left: 10%; animation-duration: 8s; animation-delay: 0s; }
.petal:nth-child(2) { left: 20%; animation-duration: 12s; animation-delay: 2s; }
.petal:nth-child(3) { left: 30%; animation-duration: 10s; animation-delay: 4s; }
.petal:nth-child(4) { left: 50%; animation-duration: 9s; animation-delay: 1s; }
.petal:nth-child(5) { left: 60%; animation-duration: 11s; animation-delay: 3s; }
.petal:nth-child(6) { left: 70%; animation-duration: 8s; animation-delay: 5s; }
.petal:nth-child(7) { left: 80%; animation-duration: 13s; animation-delay: 2s; }
.petal:nth-child(8) { left: 90%; animation-duration: 9s; animation-delay: 6s; }

@keyframes petalFall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 0.8;
  }
  10% {
    opacity: 0.8;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

/* 春天植物 */
.spring-plants {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 150px;
}

.plant {
  position: absolute;
  bottom: 0;
  width: 40px;
  height: 100px;
  background: var(--spring-primary);
  border-radius: 50px 50px 0 0;
  opacity: 0.3;
  animation: plantSway 6s ease-in-out infinite;
}

.plant:nth-child(1) { left: 5%; animation-delay: 0s; }
.plant:nth-child(2) { left: 20%; animation-delay: 2s; }
.plant:nth-child(3) { right: 20%; animation-delay: 4s; }
.plant:nth-child(4) { right: 5%; animation-delay: 1s; }

@keyframes plantSway {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}

/* ==============================================
   背景画布
   ============================================== */
#backgroundCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.6;
}

/* ==============================================
   主题切换按钮
   ============================================== */
.toggle-mode {
  position: fixed;
  top: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: var(--bg-glass);
  backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
  z-index: 100;
  box-shadow: var(--glass-shadow);
}

.toggle-mode:hover {
  transform: scale(1.1) rotate(10deg);
  background: var(--bg-input);
  box-shadow: var(--shadow-spring);
}

/* ==============================================
   页面布局
   ============================================== */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  z-index: 10;
}

/* ==============================================
   主标题区域
   ============================================== */
.main-title {
  text-align: center;
  margin-bottom: 3rem;
}

.logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.logo-icon {
  width: 80px;
  height: 80px;
  background: var(--gradient-spring);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: white;
  box-shadow: var(--shadow-spring);
  animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.main-title h1 {
  font-size: 3rem;
  font-weight: 700;
  background: var(--gradient-spring);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 300;
  margin: 0;
  opacity: 0.8;
}

/* ==============================================
   卡片容器
   ============================================== */
.container {
  width: 100%;
  max-width: 500px;
}

.card {
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-large);
  box-shadow: var(--glass-shadow);
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-spring);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-spring);
}

/* ==============================================
   Tab 导航
   ============================================== */
.tabs {
  display: flex;
  background: var(--bg-glass);
  border-radius: 50px;
  padding: 4px;
  margin-bottom: 2rem;
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
}

.tab-btn {
  flex: 1;
  padding: 12px 20px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  border-radius: 46px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.95rem;
}

.tab-btn.active {
  background: var(--gradient-spring);
  color: white;
  box-shadow: 0 4px 15px rgba(74, 222, 128, 0.4);
  transform: translateY(-1px);
}

.tab-btn:hover:not(.active) {
  color: var(--text-secondary);
  background: rgba(74, 222, 128, 0.1);
}

/* ==============================================
   表单区域
   ============================================== */
.form-section {
  transition: var(--transition-slow);
}

.form-section.hidden {
  display: none;
}

.form-header {
  text-align: center;
  margin-bottom: 2rem;
}

.form-header h2 {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.form-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
  opacity: 0.8;
}

/* ==============================================
   输入框样式
   ============================================== */
.input-group {
  margin-bottom: 1.5rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  font-size: 1.1rem;
  z-index: 2;
  transition: var(--transition);
}

.input-wrapper input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  border: 2px solid transparent;
  border-radius: var(--border-radius);
  background: var(--bg-input);
  backdrop-filter: blur(10px);
  color: var(--text-primary);
  font-size: 1rem;
  transition: var(--transition);
  outline: none;
}

.input-wrapper input:focus {
  border-color: var(--spring-primary);
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(74, 222, 128, 0.2);
}

.input-wrapper input:focus + .input-icon {
  color: var(--spring-primary);
  transform: scale(1.1);
}

.input-wrapper input::placeholder {
  color: var(--text-light);
  opacity: 0.7;
}

/* ==============================================
   按钮样式
   ============================================== */
.btn-submit {
  width: 100%;
  padding: 1rem 2rem;
  border: none;
  border-radius: var(--border-radius);
  background: var(--gradient-spring);
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 1rem;
  position: relative;
  overflow: hidden;
}

.btn-submit::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.6s ease;
}

.btn-submit:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-spring);
}

.btn-submit:hover::before {
  left: 100%;
}

.btn-submit:active {
  transform: translateY(-1px);
}

/* ==============================================
   消息提示
   ============================================== */
.form-message {
  padding: 12px 16px;
  border-radius: var(--border-radius);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}

.form-message.hidden {
  display: none;
}

.form-message.error {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.form-message.success {
  background: rgba(34, 197, 94, 0.1);
  color: #059669;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

/* ==============================================
   Toast 通知
   ============================================== */
.toast-container {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 1000;
  max-width: 400px;
}

.toast {
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  padding: 1rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--glass-shadow);
  color: var(--text-primary);
  font-weight: 500;
  transform: translateX(400px);
  opacity: 0;
  transition: var(--transition);
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.success {
  border-left: 4px solid var(--spring-primary);
}

.toast.error {
  border-left: 4px solid #ef4444;
}

/* ==============================================
   响应式设计
   ============================================== */
@media (max-width: 768px) {
  .page-wrapper {
    padding: 1rem;
  }
  
  .main-title {
    margin-bottom: 2rem;
  }
  
  .main-title h1 {
    font-size: 2.2rem;
  }
  
  .logo-icon {
    width: 60px;
    height: 60px;
    font-size: 2rem;
  }
  
  .card {
    padding: 2rem 1.5rem;
  }
  
  .toggle-mode {
    top: 1rem;
    right: 1rem;
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
  }
  
  .toast-container {
    top: 1rem;
    right: 1rem;
    left: 1rem;
    max-width: none;
  }
  
  .floating-petals {
    display: none; /* 移动端隐藏花瓣 */
  }
}

@media (max-width: 480px) {
  .tab-btn {
    font-size: 0.85rem;
    padding: 10px 16px;
  }
  
  .form-header h2 {
    font-size: 1.5rem;
  }
  
  .input-wrapper input {
    padding: 0.9rem 0.9rem 0.9rem 2.8rem;
  }
  
  .btn-submit {
    padding: 0.9rem 1.5rem;
    font-size: 1rem;
  }
}

/* ==============================================
   动画优化
   ============================================== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .floating-petals,
  .spring-plants {
    display: none;
  }
}